package pokerclient.core;

import common.GameAction;
import common.GameState;
import common.Message;

/**
 * An interface that describes all actions the client may perform towards its
 * server. Note that the client-server relationship is mainly based on the
 * client requesting data from the server.
 * 
 */
public interface IClient {

	/**
	 * Send a message to the server
	 * 
	 * @param message
	 */
	public abstract void sendMessage(Message message);

	/**
	 * Simply instantiate a ClientListener which will then be used for all
	 * future network communication by the client
	 * 
	 * @param host
	 */
	public abstract void startListener(String host);

	/**
	 * Connect to a server, sending client info and receiving basic game info
	 * (rules, other players, etc)
	 * 
	 * @param playerName
	 * @param host
	 */
	public abstract void connect(String playerName, String host);

	/**
	 * Gameplay-related actions:
	 * 
	 * @param action
	 * @param bet
	 */
	public abstract void announcePlayerAction(GameAction action, int bet);

	/**
	 * Request to be sent the game state
	 */
	public abstract void retrieveGameState();

	/**
	 * Process the game state
	 * 
	 * @param gameState
	 */
	public abstract void processGameState(GameState gameState);

	/**
	 * Request that the server starts the game (will only be allowed by
	 * theserver is the player requesting is also the game host)
	 */
	public void requestStartGame();

	/**
	 * Sets the main player in the client
	 * @param player the player to set
	 */
	void setMainPlayer(Player player);

	/**
	 * 
	 * @return
	 */
	Player getMainPlayer();


	
}
